import "package:flutter/material.dart";
import "package:myapp/_views/home/widget/animate/animate.class.dart";

import "AnimateCard_3.dart";

class AnimateRank extends StatelessWidget {
  final AnimateRankingItem item;
  const AnimateRank(this.item, {super.key});
  @override
  Widget build(BuildContext context) {
    return Container(
      margin: const EdgeInsets.all(6),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(8),
        color: const Color.fromARGB(255, 253, 240, 232),
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          const Padding(
            padding: EdgeInsets.fromLTRB(12, 16, 8, 12),
            child: Row(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Expanded(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text(
                        '热门番剧榜',
                        style: TextStyle(
                          fontSize: 17,
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                      Text(
                        '每小时更新',
                        style: TextStyle(
                          fontSize: 12,
                          color: Color.fromARGB(163, 0, 0, 0),
                        ),
                      ),
                    ],
                  ),
                ),
                Row(
                  children: [
                    Text(
                      '更多榜单',
                      style: TextStyle(
                        fontSize: 12,
                      ),
                    ),
                    Icon(
                      Icons.keyboard_arrow_right,
                      size: 16,
                    )
                  ],
                )
              ],
            ),
          ),
          SizedBox(
            height: 168,
            child: ListView.builder(
              scrollDirection: Axis.horizontal,
              itemCount: item.list.length,
              itemBuilder: (contenxt, index) {
                var e = item.list[index];
                return Container(
                  margin: EdgeInsets.only(
                      left: index == 0 ? 12 : 0,
                      right: index == item.list.length - 1 ? 12 : 8),
                  child: AnimateCard3(e),
                );
              },
            ),
          ),
        ],
      ),
    );
  }
}
